﻿/*****************************************************
**Copyright(C), 2021-2022, Ciqtek Technology.
**Version:     1.0
**Author:      yhl
**Date:        2021/11/15
**Description: 绘制各类阴影
*****************************************************/

#ifndef RENDERENGINE_H
#define RENDERENGINE_H

#include "../generalui_global.h"

#include <QObject>
#include <QPainter>
#include <QPointF>
#include <QtMath>
#include <QPainterPathStroker>

namespace GeneralUI {

	class GENERALUI_EXPORT RenderEngine
	{
	public:
		explicit RenderEngine();
		~RenderEngine();

	public:
		/**
		 * @brief drawLineShadow        绘制直线阴影
		 * @param painter
		 * @param p1
		 * @param p2
		 * @param scale                 放大
		 */
		static void drawLineShadow(QPainter *painter, QPointF p1, QPointF p2, int scale = 1);

		/**
		 * @brief drawTextShadow        绘制文字阴影
		 * @param painter
		 * @param p
		 * @param text
		 * @param scale
		 */
		static void drawTextShadow(QPainter *painter, QPointF p, QString text, int scale = 1);

		/**
		 * @brief drawTextShadow        绘制文字阴影
		 * @param painter
		 * @param p
		 * @param text
		 * @param scale
		 */
		static void drawTextShadow(QPainter *painter, QRectF rect, QString text, int scale = 1);

		/**
		 * @brief drawPathShadow        绘制 QPainterPath 的阴影
		 * @param painter
		 * @param path
		 * @param scale
		 */
		static void drawPathShadow(QPainter *painter, QPainterPath path, int scale = 1);

		/**
		 * @brief drawPathLineShadow    绘制直线路径的阴影
		 * @param painter
		 * @param path
		 * @param scale
		 */
		static void drawPathLineShadow(QPainter *painter, QPainterPath path, int scale = 1);

		/**
		 * @brief drawPathRectShadow    绘制矩形路径的阴影
		 * @param painter
		 * @param path
		 * @param scale
		 */
		static void drawPathRectShadow(QPainter *painter, QPainterPath path, int scale = 1);
	};

}//namespace OfUI

#endif // RENDERENGINE_H
